package com.tianhui.consignortwofei.mvp.ui.activity.deliverGoods.edit;

import android.text.TextUtils;
import android.view.View;

import com.tianhui.consignortwofei.mvp.ui.activity.deliverGoods.normal.DeliverGoodsStepTwoActivity;

/**
 * @author fgs
 * @date 2021/3/9
 * @description
 **/
public class EditDeliverGoodsStepTwoActivity extends DeliverGoodsStepTwoActivity {

    @Override
    public void initData() {
        //不能调用super
    }

    @Override
    public void initView() {
        super.initView();
        mGoodsTypeClickItemView.setContent(mGoodsInfo.goodstypetext);
        mGoodsNameInputItemView.setContent(mGoodsInfo.goodsdescription);
        mWeightInputItemView.setContent(mGoodsInfo.weight);
        mQuantityInputItemView.setContent(mGoodsInfo.quantity);
        mPriceInputItemView.setContent(mGoodsInfo.baseprice);
        mMaxPriceInputItemView.setContent(mGoodsInfo.bigprice);
        mTotalPriceInputItemView.setContent(mGoodsInfo.totalprice);

        if (mGoodsInfo.ishide.equals("1")) {
            mPriceStatusTabSwitchView.setDefaultSelection(1);
            mPhoneInputItemView.setContent(mGoodsInfo.facetel);
            mPhoneLinearLayout.setVisibility(View.VISIBLE);
        } else {
            mPriceStatusTabSwitchView.setDefaultSelection(0);
            mPhoneLinearLayout.setVisibility(View.GONE);
        }

        //是否拆单
        if (!TextUtils.isEmpty(mGoodsInfo.detachable) && mGoodsInfo.detachable.equals("1")) {
            mDetachableTabSwitchView.setDefaultSelection(1);
            mDetachWeightLinearLayout.setVisibility(View.VISIBLE);
            mDetachWeightInputItemView.setContent(mGoodsInfo.detachweight);
        } else {
            mDetachableTabSwitchView.setDefaultSelection(0);
            mDetachWeightLinearLayout.setVisibility(View.GONE);
        }
    }
    @Override
    protected void openNextActivity() {
        openNextStepActivity(EditDeliverGoodsStepThreeActivity.class);
    }
}
